Add an extra parameter use_text to gtk_paint_label() to deal with
authorOwen Taylor <otaylor@redhat.com>
Mon, 30 Apr 2001 23:23:54 +0000 (23:23 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 30 Apr 2001 23:23:54 +0000 (23:23 +0000)
Mon Apr 30 19:18:07 2001  Owen Taylor  <otaylor@redhat.com>

* gtk/gtkstyle.[ch] gtk/gtkaccellabel.c gtk/gtkcellrenderertext.c
  gtk/gtkhruler.c gtk/gtkhscale.c gtk/gtklabel.c gtk/gtkprogressbar.c
  gtk/gtkvruler.c gtk/gtkvscale.c: Add an extra parameter
          use_text to gtk_paint_label() to deal with style->bg[] vs style->text[].

* gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
  with GtkWidget::interior_focus = TRUE better.

* gtk/gtkbutton.c

* gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove
G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
change that had to be made with g_object_get.

22 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkaccellabel.c
gtk/gtkbbox.c
gtk/gtkbutton.c
gtk/gtkcellrenderertext.c
gtk/gtkdialog.c
gtk/gtkhruler.c
gtk/gtkhscale.c
gtk/gtklabel.c
gtk/gtkoptionmenu.c
gtk/gtkprogressbar.c
gtk/gtkstyle.c
gtk/gtkstyle.h
gtk/gtkvruler.c
gtk/gtkvscale.c
gtk/gtkwidget.c

index d463e549c1340a3a2360ae4885d45b02ee74995b..e570a56ecbd3b710d999f8c2a41739b51f2fad95 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Mon Apr 30 19:18:07 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.[ch] gtk/gtkaccellabel.c gtk/gtkcellrenderertext.c
+         gtk/gtkhruler.c gtk/gtkhscale.c gtk/gtklabel.c gtk/gtkprogressbar.c
+         gtk/gtkvruler.c gtk/gtkvscale.c: Add an extra parameter
+          use_text to gtk_paint_label() to deal with style->bg[] vs style->text[].
+
+       * gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
+         with GtkWidget::interior_focus = TRUE better.
+
+       * gtk/gtkbutton.c
+
+       * gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove 
+       G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
+       change that had to be made with g_object_get.
+
 Sun Apr 29 20:13:40 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_get_columns): new function.
index d463e549c1340a3a2360ae4885d45b02ee74995b..e570a56ecbd3b710d999f8c2a41739b51f2fad95 100644 (file)
@@ -1,3 +1,19 @@
+Mon Apr 30 19:18:07 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.[ch] gtk/gtkaccellabel.c gtk/gtkcellrenderertext.c
+         gtk/gtkhruler.c gtk/gtkhscale.c gtk/gtklabel.c gtk/gtkprogressbar.c
+         gtk/gtkvruler.c gtk/gtkvscale.c: Add an extra parameter
+          use_text to gtk_paint_label() to deal with style->bg[] vs style->text[].
+
+       * gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
+         with GtkWidget::interior_focus = TRUE better.
+
+       * gtk/gtkbutton.c
+
+       * gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove 
+       G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
+       change that had to be made with g_object_get.
+
 Sun Apr 29 20:13:40 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_get_columns): new function.
index d463e549c1340a3a2360ae4885d45b02ee74995b..e570a56ecbd3b710d999f8c2a41739b51f2fad95 100644 (file)
@@ -1,3 +1,19 @@
+Mon Apr 30 19:18:07 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.[ch] gtk/gtkaccellabel.c gtk/gtkcellrenderertext.c
+         gtk/gtkhruler.c gtk/gtkhscale.c gtk/gtklabel.c gtk/gtkprogressbar.c
+         gtk/gtkvruler.c gtk/gtkvscale.c: Add an extra parameter
+          use_text to gtk_paint_label() to deal with style->bg[] vs style->text[].
+
+       * gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
+         with GtkWidget::interior_focus = TRUE better.
+
+       * gtk/gtkbutton.c
+
+       * gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove 
+       G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
+       change that had to be made with g_object_get.
+
 Sun Apr 29 20:13:40 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_get_columns): new function.
index d463e549c1340a3a2360ae4885d45b02ee74995b..e570a56ecbd3b710d999f8c2a41739b51f2fad95 100644 (file)
@@ -1,3 +1,19 @@
+Mon Apr 30 19:18:07 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.[ch] gtk/gtkaccellabel.c gtk/gtkcellrenderertext.c
+         gtk/gtkhruler.c gtk/gtkhscale.c gtk/gtklabel.c gtk/gtkprogressbar.c
+         gtk/gtkvruler.c gtk/gtkvscale.c: Add an extra parameter
+          use_text to gtk_paint_label() to deal with style->bg[] vs style->text[].
+
+       * gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
+         with GtkWidget::interior_focus = TRUE better.
+
+       * gtk/gtkbutton.c
+
+       * gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove 
+       G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
+       change that had to be made with g_object_get.
+
 Sun Apr 29 20:13:40 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_get_columns): new function.
index d463e549c1340a3a2360ae4885d45b02ee74995b..e570a56ecbd3b710d999f8c2a41739b51f2fad95 100644 (file)
@@ -1,3 +1,19 @@
+Mon Apr 30 19:18:07 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.[ch] gtk/gtkaccellabel.c gtk/gtkcellrenderertext.c
+         gtk/gtkhruler.c gtk/gtkhscale.c gtk/gtklabel.c gtk/gtkprogressbar.c
+         gtk/gtkvruler.c gtk/gtkvscale.c: Add an extra parameter
+          use_text to gtk_paint_label() to deal with style->bg[] vs style->text[].
+
+       * gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
+         with GtkWidget::interior_focus = TRUE better.
+
+       * gtk/gtkbutton.c
+
+       * gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove 
+       G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
+       change that had to be made with g_object_get.
+
 Sun Apr 29 20:13:40 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_get_columns): new function.
index d463e549c1340a3a2360ae4885d45b02ee74995b..e570a56ecbd3b710d999f8c2a41739b51f2fad95 100644 (file)
@@ -1,3 +1,19 @@
+Mon Apr 30 19:18:07 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.[ch] gtk/gtkaccellabel.c gtk/gtkcellrenderertext.c
+         gtk/gtkhruler.c gtk/gtkhscale.c gtk/gtklabel.c gtk/gtkprogressbar.c
+         gtk/gtkvruler.c gtk/gtkvscale.c: Add an extra parameter
+          use_text to gtk_paint_label() to deal with style->bg[] vs style->text[].
+
+       * gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
+         with GtkWidget::interior_focus = TRUE better.
+
+       * gtk/gtkbutton.c
+
+       * gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove 
+       G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
+       change that had to be made with g_object_get.
+
 Sun Apr 29 20:13:40 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_get_columns): new function.
index d463e549c1340a3a2360ae4885d45b02ee74995b..e570a56ecbd3b710d999f8c2a41739b51f2fad95 100644 (file)
@@ -1,3 +1,19 @@
+Mon Apr 30 19:18:07 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkstyle.[ch] gtk/gtkaccellabel.c gtk/gtkcellrenderertext.c
+         gtk/gtkhruler.c gtk/gtkhscale.c gtk/gtklabel.c gtk/gtkprogressbar.c
+         gtk/gtkvruler.c gtk/gtkvscale.c: Add an extra parameter
+          use_text to gtk_paint_label() to deal with style->bg[] vs style->text[].
+
+       * gtk/gtkbbox.c gtk/gtkdialog.c: Tweak padding some to deal
+         with GtkWidget::interior_focus = TRUE better.
+
+       * gtk/gtkbutton.c
+
+       * gtk/gtkwidget.c (gtk_widget_style_get_valist): Remove 
+       G_VALUE_NO_COPY_CONTENTS, to correspond with the recent
+       change that had to be made with g_object_get.
+
 Sun Apr 29 20:13:40 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_get_columns): new function.
index c872677d8f2a5579b42f2fc9c3c88ddc4ab883e0..bb332f1fa98688256346322ddde6f737c2347201 100644 (file)
@@ -292,6 +292,7 @@ gtk_accel_label_expose_event (GtkWidget      *widget,
           gtk_paint_layout (widget->style,
                             widget->window,
                             GTK_WIDGET_STATE (widget),
+                           FALSE,
                             &event->area,
                             widget,
                             "accellabel",
index 720248e95fb14de17cf6856b7eb376dfa62afd9d..51f2bb5e14825625aafd58c1f82c6c3d48b52846 100644 (file)
@@ -33,7 +33,7 @@ static void gtk_button_box_init          (GtkButtonBox        *box);
 
 #define DEFAULT_CHILD_MIN_WIDTH 85
 #define DEFAULT_CHILD_MIN_HEIGHT 27
-#define DEFAULT_CHILD_IPAD_X 7
+#define DEFAULT_CHILD_IPAD_X 4
 #define DEFAULT_CHILD_IPAD_Y 0
 
 GtkType
index bb9a0cd2e44fd8ab5ceea04e10ed93ba687c1978..38eee057126e26fdb30758e00184bedee8fdfb60 100644 (file)
@@ -36,7 +36,9 @@
 #include "gtkintl.h"
 
 #define CHILD_SPACING     1
-#define DEFAULT_SPACING   7
+
+static GtkBorder default_default_border = { 5, 5, 6, 6 };
+static GtkBorder default_default_outside_border = { 5, 5, 6, 6 };
 
 /* Time out before giving up on getting a key release when animatng
  * the close button.
@@ -233,13 +235,18 @@ gtk_button_class_init (GtkButtonClass *klass)
   widget_class->activate_signal = button_signals[ACTIVATE];
 
   gtk_widget_class_install_style_property (widget_class,
-                                          g_param_spec_int ("default_spacing",
-                                                            _("Default Spacing"),
-                                                            _("Extra space to add for CAN_DEFAULT buttons"),
-                                                            0,
-                                                            G_MAXINT,
-                                                            DEFAULT_SPACING,
-                                                            G_PARAM_READABLE));
+                                          g_param_spec_boxed ("default_border",
+                                                              _("Default Spacing"),
+                                                              _("Extra space to add for CAN_DEFAULT buttons"),
+                                                              GTK_TYPE_BORDER,
+                                                              G_PARAM_READABLE));
+
+  gtk_widget_class_install_style_property (widget_class,
+                                          g_param_spec_boxed ("default_outside_border",
+                                                              _("Default Outside Spacing"),
+                                                              _("Extra space to add for CAN_DEFAULT buttons that is always drawn outside the border"),
+                                                              GTK_TYPE_BORDER,
+                                                              G_PARAM_READABLE));
 }
 
 static void
@@ -540,13 +547,38 @@ gtk_button_unrealize (GtkWidget *widget)
 
 static void
 gtk_button_get_props (GtkButton *button,
-                     gint      *default_spacing,
+                     GtkBorder *default_border,
+                     GtkBorder *default_outside_border,
                      gboolean  *interior_focus)
 {
   GtkWidget *widget =  GTK_WIDGET (button);
+  GtkBorder *tmp_border;
+
+  if (default_border)
+    {
+      gtk_widget_style_get (widget, "default_border", &tmp_border, NULL);
+
+      if (tmp_border)
+       {
+         *default_border = *tmp_border;
+         g_free (tmp_border);
+       }
+      else
+       *default_border = default_default_border;
+    }
 
-  if (default_spacing)
-    gtk_widget_style_get (widget, "default_spacing", default_spacing, NULL);
+  if (default_outside_border)
+    {
+      gtk_widget_style_get (widget, "default_outside_border", &tmp_border, NULL);
+
+      if (tmp_border)
+       {
+         *default_outside_border = *tmp_border;
+         g_free (tmp_border);
+       }
+      else
+       *default_outside_border = default_default_outside_border;
+    }
 
   if (interior_focus)
     gtk_widget_style_get (widget, "interior_focus", interior_focus, NULL);
@@ -557,10 +589,10 @@ gtk_button_size_request (GtkWidget      *widget,
                         GtkRequisition *requisition)
 {
   GtkButton *button = GTK_BUTTON (widget);
-  gint default_spacing;
+  GtkBorder default_border;
   gboolean interior_focus;
 
-  gtk_button_get_props (button, &default_spacing, &interior_focus);
+  gtk_button_get_props (button, &default_border, NULL, &interior_focus);
   
   requisition->width = (GTK_CONTAINER (widget)->border_width + CHILD_SPACING +
                        GTK_WIDGET (widget)->style->xthickness) * 2;
@@ -569,10 +601,8 @@ gtk_button_size_request (GtkWidget      *widget,
 
   if (GTK_WIDGET_CAN_DEFAULT (widget))
     {
-      requisition->width += (GTK_WIDGET (widget)->style->xthickness * 2 +
-                            default_spacing);
-      requisition->height += (GTK_WIDGET (widget)->style->ythickness * 2 +
-                             default_spacing);
+      requisition->width += default_border.left + default_border.right;
+      requisition->height += default_border.top + default_border.bottom;
     }
 
   if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
@@ -602,9 +632,9 @@ gtk_button_size_allocate (GtkWidget     *widget,
   gint border_width = GTK_CONTAINER (widget)->border_width;
   gint xthickness = GTK_WIDGET (widget)->style->xthickness;
   gint ythickness = GTK_WIDGET (widget)->style->ythickness;
-  gint default_spacing;
+  GtkBorder default_border;
 
-  gtk_button_get_props (button, &default_spacing, NULL);
+  gtk_button_get_props (button, &default_border, NULL, NULL);
   
   widget->allocation = *allocation;
 
@@ -627,14 +657,10 @@ gtk_button_size_allocate (GtkWidget     *widget,
 
       if (GTK_WIDGET_CAN_DEFAULT (button))
        {
-         child_allocation.x += (GTK_WIDGET (widget)->style->xthickness +
-                                (1 + default_spacing) / 2);
-         child_allocation.y += (GTK_WIDGET (widget)->style->ythickness +
-                                (1 + default_spacing) / 2);
-         child_allocation.width =  MAX (1, (gint)child_allocation.width -
-                                        (gint)(GTK_WIDGET (widget)->style->xthickness * 2 + default_spacing));
-         child_allocation.height = MAX (1, (gint)child_allocation.height -
-                                        (gint)(GTK_WIDGET (widget)->style->xthickness * 2 + default_spacing));
+         child_allocation.x += default_border.left;
+         child_allocation.y += default_border.top;
+         child_allocation.width =  MAX (1, child_allocation.width - default_border.left - default_border.right);
+         child_allocation.height = MAX (1, child_allocation.height - default_border.top - default_border.bottom);
        }
 
       gtk_widget_size_allocate (GTK_BIN (button)->child, &child_allocation);
@@ -675,14 +701,15 @@ gtk_button_paint (GtkWidget    *widget,
   GtkShadowType shadow_type;
   gint width, height;
   gint x, y;
-  gint default_spacing;
+  GtkBorder default_border;
+  GtkBorder default_outside_border;
   gboolean interior_focus;
    
   if (GTK_WIDGET_DRAWABLE (widget))
     {
       button = GTK_BUTTON (widget);
 
-      gtk_button_get_props (button, &default_spacing, &interior_focus);
+      gtk_button_get_props (button, &default_border, &default_outside_border, &interior_focus);
        
       x = 0;
       y = 0;
@@ -699,16 +726,18 @@ gtk_button_paint (GtkWidget    *widget,
                         GTK_STATE_NORMAL, GTK_SHADOW_IN,
                         area, widget, "buttondefault",
                         x, y, width, height);
-       }
 
-      if (GTK_WIDGET_CAN_DEFAULT (widget))
+         x += default_border.left;
+         y += default_border.top;
+         width -= default_border.left + default_border.right;
+         height -= default_border.top + default_border.bottom;
+       }
+      else if (GTK_WIDGET_CAN_DEFAULT (widget))
        {
-         x += widget->style->xthickness;
-         y += widget->style->ythickness;
-         width -= 2 * x + default_spacing;
-         height -= 2 * y + default_spacing;
-         x += (1 + default_spacing) / 2;
-         y += (1 + default_spacing) / 2;
+         x += default_outside_border.left;
+         y += default_outside_border.top;
+         width -= default_outside_border.left + default_outside_border.right;
+         height -= default_outside_border.top + default_outside_border.bottom;
        }
        
       if (!interior_focus && GTK_WIDGET_HAS_FOCUS (widget))
index 50afc6b8f9baa2a4cdd434f746272025692a266c..9a6f65cbfd1d2cd3a4c54ed26e7428d3dfaefe9d 100644 (file)
@@ -1139,6 +1139,7 @@ gtk_cell_renderer_text_render (GtkCellRenderer    *cell,
   gtk_paint_layout (widget->style,
                     window,
                     state,
+                   TRUE,
                     cell_area,
                     widget,
                     "cellrenderertext",
index 324f781d157f4aa377f04a7f3cc7bc7a876d51bf..c0f0ea1181cda4a050c833c92cfa9121e6c6e7ff 100644 (file)
@@ -146,7 +146,7 @@ gtk_dialog_class_init (GtkDialogClass *class)
                                                              _("Spacing between buttons"),
                                                              0,
                                                              G_MAXINT,
-                                                             1,
+                                                             10,
                                                              G_PARAM_READABLE));
   
   gtk_widget_class_install_style_property (widget_class,
@@ -155,7 +155,7 @@ gtk_dialog_class_init (GtkDialogClass *class)
                                                              _("Width of border around the button area at the bottom of the dialog"),
                                                              0,
                                                              G_MAXINT,
-                                                             0,
+                                                             5,
                                                              G_PARAM_READABLE));
 }
 
index d1d637c4af7e091fa248dbcb3930737bf40e19c3..c220d14f7911faaf2e4e8d3affda6968ab8fe54b 100644 (file)
@@ -264,6 +264,7 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
               gtk_paint_layout (widget->style,
                                 ruler->backing_store,
                                 GTK_WIDGET_STATE (widget),
+                               FALSE,
                                 NULL,
                                 widget,
                                 "hruler",
index 43739548bbcc7bb236a16eea67bb4676fb9af075..0fa644b68ae680bde95bfbfd5d12e210f6179e4c 100644 (file)
@@ -588,6 +588,7 @@ gtk_hscale_draw_value (GtkScale *scale)
       gtk_paint_layout (widget->style,
                         widget->window,
                         state_type,
+                       FALSE,
                         NULL,
                         widget,
                         "hscale",
index 028b6a709e29bdd5edc3ff8eb9d933e8aa1a38a9..ddcfd428f7f1ce40e9cc0c4e293b527ea40e9912 100644 (file)
@@ -1258,6 +1258,7 @@ gtk_label_expose (GtkWidget      *widget,
       gtk_paint_layout (widget->style,
                         widget->window,
                         GTK_WIDGET_STATE (widget),
+                       FALSE,
                         &event->area,
                         widget,
                         "label",
index 6c8a18f4c39fa9033fe6846c402e255191d4b178..7343efffb49009ebbdf002f60e90719491543f42 100644 (file)
@@ -41,11 +41,13 @@ typedef struct _GtkOptionMenuProps GtkOptionMenuProps;
 
 struct _GtkOptionMenuProps
 {
+  gboolean interior_focus;
   GtkRequisition indicator_size;
   GtkBorder indicator_spacing;
 };
 
 static GtkOptionMenuProps default_props = {
+  FALSE,
   { 12, 8 },
   { 3, 7, 2, 2 }               /* Left, right, top, bottom */
 };
@@ -336,6 +338,7 @@ gtk_option_menu_get_props (GtkOptionMenu       *option_menu,
   gtk_widget_style_get (GTK_WIDGET (option_menu),
                        "indicator_size", &indicator_size,
                        "indicator_spacing", &indicator_spacing,
+                       "interior_focus", &props->interior_focus,
                        NULL);
 
   if (indicator_size)
@@ -439,19 +442,29 @@ gtk_option_menu_paint (GtkWidget    *widget,
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
+      gint border_width = GTK_CONTAINER (widget)->border_width;
+       
       gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props);
 
-      button_area.x = GTK_CONTAINER (widget)->border_width + 1;
-      button_area.y = GTK_CONTAINER (widget)->border_width + 1;
-      button_area.width = widget->allocation.width - button_area.x * 2;
-      button_area.height = widget->allocation.height - button_area.y * 2;
+      button_area.x = border_width;
+      button_area.y = border_width;
+      button_area.width = widget->allocation.width - 2 * border_width;
+      button_area.height = widget->allocation.height - 2 * border_width;
 
-      /* This is evil, and should be elimated here and in the button
-       * code. The point is to clear the focus, and make it
-       * sort of transparent if it isn't there.
-       */
-      gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
-      gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+      if (!props.interior_focus)
+       {
+         button_area.x += 1;
+         button_area.y += 1;
+         button_area.width -= 2;
+         button_area.height -= 2;
+
+         /* This is evil, and should be elimated here and in the button
+          * code. The point is to clear the focus, and make it
+          * sort of transparent if it isn't there.
+          */
+         gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+         gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
+       }
 
       gtk_paint_box(widget->style, widget->window,
                    GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
@@ -469,12 +482,30 @@ gtk_option_menu_paint (GtkWidget    *widget,
                     props.indicator_size.width, props.indicator_size.height);
       
       if (GTK_WIDGET_HAS_FOCUS (widget))
-       gtk_paint_focus (widget->style, widget->window,
-                        area, widget, "button",
-                        button_area.x - 1, 
-                        button_area.y - 1, 
-                        button_area.width + 1,
-                        button_area.height + 1);
+       {
+         if (props.interior_focus)
+           {
+             button_area.x += widget->style->xthickness + 1;
+             button_area.y += widget->style->ythickness + 1;
+             button_area.width -= 2 * (widget->style->xthickness + 1)
+               + props.indicator_spacing.left + props.indicator_spacing.right + props.indicator_size.width;
+             button_area.height -= 2 * (widget->style->ythickness + 1);
+           }
+         else
+           {
+             button_area.x -= 1;
+             button_area.y -= 1;
+             button_area.width += 2;
+             button_area.height += 2;
+           }
+           
+         gtk_paint_focus (widget->style, widget->window,
+                          area, widget, "button",
+                          button_area.x, 
+                          button_area.y, 
+                          button_area.width - 1,
+                          button_area.height - 1);
+       }
     }
 }
 
index af1e82cd5010ac30b9716af0019ebfa9b25baacc..c02a9814d5ecb6c77d98c706c1a063c59190566f 100644 (file)
@@ -833,6 +833,7 @@ gtk_progress_bar_paint (GtkProgress *progress)
           gtk_paint_layout (widget->style,
                             progress->offscreen_pixmap,
                             GTK_WIDGET_STATE (widget),
+                           FALSE,
                             &rect,
                             widget,
                             "progressbar",
index d0c46fd91ca63537a9e22aed4a1e1146b737340e..3bc711cd9a79c1a461027770425ef4cc455c44ef 100644 (file)
@@ -281,6 +281,7 @@ static void gtk_default_draw_expander   (GtkStyle        *style,
 static void gtk_default_draw_layout     (GtkStyle        *style,
                                          GdkWindow       *window,
                                          GtkStateType     state_type,
+                                        gboolean         use_text,
                                          GdkRectangle    *area,
                                          GtkWidget       *widget,
                                          const gchar     *detail,
@@ -1030,6 +1031,7 @@ void
 gtk_draw_layout (GtkStyle        *style,
                  GdkWindow       *window,
                  GtkStateType     state_type,
+                gboolean         use_text,
                  gint             x,
                  gint             y,
                  PangoLayout     *layout)
@@ -1037,7 +1039,7 @@ gtk_draw_layout (GtkStyle        *style,
   g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_layout != NULL);
   
-  GTK_STYLE_GET_CLASS (style)->draw_layout (style, window, state_type,
+  GTK_STYLE_GET_CLASS (style)->draw_layout (style, window, state_type, use_text,
                                             NULL, NULL, NULL,
                                             x, y, layout);
 }
@@ -3903,6 +3905,7 @@ static void
 gtk_default_draw_layout (GtkStyle        *style,
                          GdkWindow       *window,
                          GtkStateType     state_type,
+                        gboolean         use_text,
                          GdkRectangle    *area,
                          GtkWidget       *widget,
                          const gchar     *detail,
@@ -3910,11 +3913,15 @@ gtk_default_draw_layout (GtkStyle        *style,
                          gint             y,
                          PangoLayout     *layout)
 {
+  GdkGC *gc;
+  
   g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
+
+  gc = use_text ? style->text_gc[state_type] : style->fg_gc[state_type];
   
   if (area)
-    gdk_gc_set_clip_rectangle (style->text_gc[state_type], area);
+    gdk_gc_set_clip_rectangle (gc, area);
 
   if (state_type == GTK_STATE_INSENSITIVE)
     {
@@ -3922,17 +3929,17 @@ gtk_default_draw_layout (GtkStyle        *style,
 
       ins = get_insensitive_layout (layout);
       
-      gdk_draw_layout (window, style->text_gc[state_type], x, y, ins);
+      gdk_draw_layout (window, gc, x, y, ins);
 
       g_object_unref (G_OBJECT (ins));
     }
   else
     {
-      gdk_draw_layout (window, style->text_gc[state_type], x, y, layout);
+      gdk_draw_layout (window, gc, x, y, layout);
     }
 
   if (area)
-    gdk_gc_set_clip_rectangle (style->text_gc[state_type], NULL);
+    gdk_gc_set_clip_rectangle (gc, NULL);
 }
 
 static void
@@ -4561,6 +4568,7 @@ void
 gtk_paint_layout (GtkStyle        *style,
                   GdkWindow       *window,
                   GtkStateType     state_type,
+                 gboolean         use_text,
                   GdkRectangle    *area,
                   GtkWidget       *widget,
                   const gchar     *detail,
@@ -4571,7 +4579,7 @@ gtk_paint_layout (GtkStyle        *style,
   g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_layout != NULL);
   
-  GTK_STYLE_GET_CLASS (style)->draw_layout (style, window, state_type, area,
+  GTK_STYLE_GET_CLASS (style)->draw_layout (style, window, state_type, use_text, area,
                                             widget, detail, x, y, layout);
 }
 
index a07965f5ceb9576f9e2d4aa94828382ad8f90397..1109071c07a3105e36cb0861ee221a9cb44b020b 100644 (file)
@@ -381,6 +381,7 @@ struct _GtkStyleClass
   void (*draw_layout)          (GtkStyle               *style,
                                 GdkWindow              *window,
                                 GtkStateType            state_type,
+                                gboolean                use_text,
                                 GdkRectangle           *area,
                                 GtkWidget              *widget,
                                 const gchar            *detail,
@@ -588,6 +589,7 @@ void gtk_draw_expander   (GtkStyle        *style,
 void gtk_draw_layout     (GtkStyle        *style,
                           GdkWindow       *window,
                           GtkStateType     state_type,
+                         gboolean         use_text,
                           gint             x,
                           gint             y,
                           PangoLayout     *layout);
@@ -804,6 +806,7 @@ void gtk_paint_expander   (GtkStyle        *style,
 void gtk_paint_layout     (GtkStyle        *style,
                            GdkWindow       *window,
                            GtkStateType     state_type,
+                          gboolean         use_text,
                            GdkRectangle    *area,
                            GtkWidget       *widget,
                            const gchar     *detail,
index 6b5d6caa82312c9f867e046d00647d9278dbe075..e22cfb30dc03fbadbbe2227bcfd53de52652f35d 100644 (file)
@@ -261,6 +261,7 @@ gtk_vruler_draw_ticks (GtkRuler *ruler)
                   gtk_paint_layout (widget->style,
                                     ruler->backing_store,
                                     GTK_WIDGET_STATE (widget),
+                                   FALSE,
                                     NULL,
                                     widget,
                                     "vruler",
index 71e4a0e799cc61f584ddd4251a1da6dde751d7b5..72b8b209aa9b0961ea1f44d26579e724cc7716ca 100644 (file)
@@ -598,6 +598,7 @@ gtk_vscale_draw_value (GtkScale *scale)
       gtk_paint_layout (widget->style,
                         widget->window,
                         state_type,
+                       FALSE,
                         NULL,
                         widget,
                         "vscale",
index 8e89f6f3e6c971d8ef7e6eb473505d1a552e189d..8692ca65f9e8c57cd636e9d2c47d1decaef55352 100644 (file)
@@ -5504,7 +5504,7 @@ gtk_widget_style_get_valist (GtkWidget   *widget,
                                                   G_OBJECT_TYPE (widget),
                                                   pspec,
                                                   g_param_spec_get_qdata (pspec, quark_property_parser));
-      G_VALUE_LCOPY (peek_value, var_args, G_VALUE_NOCOPY_CONTENTS, &error);
+      G_VALUE_LCOPY (peek_value, var_args, 0, &error);
       if (error)
        {
          g_warning ("%s: %s", G_STRLOC, error);